package src.main.java.org.oop.oopDemo;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Movie[] movies = new Movie[4];
        Movie m1 = new Movie(1,"水门桥",38.9,9.8,"徐克","吴京","12万人想看");
        Movie m2 = new Movie(2,"出拳吧",42.9,8.8,"唐晓白","田雨","10万人想看");
        Movie m3 = new Movie(3,"月球陨落",37.9,9.6,"罗兰","贝瑞","17.8万人想看");
        Movie m4 = new Movie(4,"一点就到家",35,8.7,"许宏宇","刘昊然","10.8万人想看");
        movies[0] = m1;
        movies[1] = m2;
        movies[2] = m3;
        movies[3] = m4;
        MovieOperator movieOperator = new MovieOperator(movies);

        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("====电影信息系统====");
            System.out.println("1.查询全部电影信息");
            System.out.println("2.根据id查询某个电影的详细信息展示");
            System.out.println("请输入您的操作指令");
            int command = sc.nextInt();
            switch (command){
                case 1:
                    movieOperator.printAllMovies();
                    break;
                case 2:
                    System.out.println("请输入您要查询的电影id:");
                    int id = sc.nextInt();
                    movieOperator.searchMovieById(id);
                    break;
                default:
                    System.out.println("您输入的指令有问题！");
            }
        }
    }
}
